#include <iostream>
#include <fstream>
#include <vector>
#include <cassert>
using namespace std;

typedef int keytype;

void select(vector<keytype> &keys)
{
  int i, j, p;
  keytype t;
  
  for (i = 0; i < keys.size(); i++){
    for (j = i, p = i; j < keys.size(); j++)
      if (keys[j] < keys[p]) p = j;
    t = keys[i];
    keys[i] = keys[p];
    keys[p] = t;
  }
}

void print(vector<keytype> &keys)
{
  for (auto it = keys.begin(); it != keys.end(); it++)
    cout << *it << "\t";
  cout << endl;
}

int main()
{
  ifstream in("sort.txt");
  vector<keytype> keys;
  keytype k;

  assert(in);
  while (in >> k)
    keys.push_back(k);

  select(keys);
  print(keys);
  in.close();

  return 0;
}
